package hot100;

import java.util.HashMap;

/**
 * @Author: wzp
 * @CreateTime: 2024-09-06  11:14
 * @Description: TODO
 * @Version: 1.0
 */
public class hot_01 {
    public int[] twoSum(int[] nums, int target) {
//        建立一个hash表 int int 类型
        HashMap<Integer,Integer> map=new HashMap<>();
        int[] result=new int[2];
        for (int i=0;i<nums.length;i++){
            if(map.containsKey(nums[i])){
                result[0]=map.get(nums[i]);
                result[1]=i;
                break;
            }else {
                map.put(target-nums[i],i);
            }
        }
        return result;
    }

    public static void main(String[] args) {
        float a=0.1f*0.1f;
        System.out.println(a);
    }
}
